<admintpl file="header" />
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:U('Bdrunpeople/company_list/')}">团队管理</a></li>
        <li class="active"><a href="#')">团队修改</a></li>
    </ul>

    <form  id="myform2" name="fileinfo" class="form-horizontal js-ajax-form" action="{:U('Bdrunpeople/company_edit')}" method="post" >

        <fieldset>
            <input type="hidden" name="pid" value="{$data.company_id}">
            <div class="control-group">
                <label class="control-label">城市:</label>
                <div class="controls">
                    <select onchange="CityChanged();" id="city"  name="province_id">
                        <option value="">==请选择省==</option>
                        <volist name="province_data" id="vo">
                            <if condition="$data['province_id'] == $vo['id']" >
                                <option value="{$vo.id}" selected>{$vo.name}</option>
                                <else/>
                                <option value="{$vo.id}" >{$vo.name}</option>
                            </if>
                        </volist>
                    </select>


                    <php>if(count($citys)>0){ </php>

                    <select name="city_id" id="city_id">
                        <volist name="citys" id="vo">
                            <if condition="$data['city_id'] == $vo['city_id']" >
                                <option value="{$vo.city_id}" selected>{$vo.city_name}</option>
                                <else/>
                                <option value="{$vo.city_id}" >{$vo.city_name}</option>
                            </if>
                        </volist>
                    </select>
                    <php>}else{</php>
                    <select name="city_id" id="city_id">
                    </select>



                    <php>}</php>

                </div>
                <div class="control-group">
                </div>
                <div class="control-group">
                    <label class="control-label">团队名称:</label>
                    <div class="controls">
                        <input style="width: 150px;" name="company_name" type="text" value="{$data.company_name}" required/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">默认第一个显示:</label>
                    <div class="controls">
                        <select class="select_2" name="status" style="width: 70px;" >
                            <if condition="$data['status'] == 0" >
                                <option value='0' selected>否</option>
                                <option value='1' }>是</option>
                                <else/>
                                <option value='1' selected}>是</option>
                                <option value='0' >否</option>
                            </if>


                        </select>
                    </div>
                </div>

                    <div class="control-group">

                    </div>
                </table>
            </div>
        </fieldset>
        <input type="hidden" name="formget[city]" value="{$formget.city}">
        <input type="hidden" name="formget[city_id]" value="{$formget[city_id]}">
        <input type="hidden" name="company_id" value="{$data.company_id}">
        <div class="form-actions">
            <button type="submit" class="btn btn-primary js-ajax-submit">{:L('SAVE')}</button>
            <a class="btn" href="{:U('Bdrunpeople/company_list',array('formget'=>$formget))}">{:L('BACK')}</a>
        </div>
    </form>
</div>
<script>

    function CityChanged(province_id){

        $.ajax({
            url:"{:U('Operation/location_api')}",
            data:"province_id="+$("#city").val(),
            dataType:"JSON",
            success:function(ret){

                cmbAddOption(ret.retValue);
            }
        });
    }

    function cmbAddOption(ret)
    {
        $("#city_id").empty();
        var opetion = null;
        for(var i =0; i<ret.length;i++){
            opetion+= '<option value="'+ret[i].id+'">'+ret[i].city+'</option>';
        }
        $("#city_id").append(opetion);
    }
</script>
<script src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/content_addtop.js"></script>

</body>
</html>